# Generated by Django 4.0.7 on 2022-09-08 07:58

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("check", "0017_alter_bras_ip"),
    ]

    operations = [
        migrations.CreateModel(
            name="UsersActions",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "time",
                    models.DateTimeField(auto_now_add=True, verbose_name="Дата/время"),
                ),
                ("action", models.TextField(max_length=1024, verbose_name="Действия")),
                (
                    "device",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="check.devices",
                        verbose_name="Оборудование",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="Пользователь",
                    ),
                ),
            ],
            options={
                "verbose_name": "User Action",
                "verbose_name_plural": "Users Actions",
                "db_table": "users_actions",
                "ordering": ("time",),
            },
        ),
        migrations.AddIndex(
            model_name="usersactions",
            index=models.Index(fields=["time"], name="logs_time_index"),
        ),
    ]
